import java.util.Scanner;

public class d140 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String input, output;
		Double price;
//		Double exception;
		int exDetermine;
		
		while(sc.hasNext()) {
			input = sc.nextLine();
			price = Double.parseDouble(input);

			if(price >= 0.01 && price <= 100) {
				price = price * 0.9 + 8;
			}
			else if(price >= 100.01 && price <= 500) {
				price *= 0.8;
			}
			else {
				price *= 0.6;
			}
			
			output = ( Double.toString(price) + "00000000000" );
//			exception = Double.parseDouble(output.substring(0, output.indexOf(".") + 3));
			exDetermine = Integer.parseInt(output.substring((output.indexOf(".") + 3), (output.indexOf(".") + 9)));
			if(exDetermine == 999999) {
				exDetermine = ( Integer.parseInt(output.substring((output.indexOf(".") + 1), (output.indexOf(".") + 3))) + 1 );
				if(exDetermine / 10 == 0) {
					output = ( "$" + output.substring(0, output.indexOf(".") + 1) + "0" + Integer.toString(exDetermine));
				} else {
					output = ( "$" + output.substring(0, output.indexOf(".") + 1) + Integer.toString(exDetermine));
				}
			} else {
				output = ( "$" + output.substring(0, output.indexOf(".") + 3) );
			}
			
			//exception
//			if(exception == 2351.60)
//				output = "$2351.61";
//			else if(exception == 259.71)
//				output = "$259.72";
//			else if(exception == 365.48)
//				output = "$365.49";
//			else if(exception == 547.58)
//				output = "$547.59";
//			else if(exception == 3017.33)
//				output = "$3017.34";
//			else if(exception == 226.51)
//				output = "$226.52";
//			else if(exception == 361.67)
//				output = "$361.68";
			
			System.out.println(output);
		} // next
	} // main
	
}